import service from '@/utils/request'

export const useCarApi = (id: number) => {
  return service.get('/biz/car/' + id)
}

export const useCarSubmitProApi = (dataForm: any) => {
  // if (dataForm.car.id) {
    return service.put('biz/car/edit', dataForm)
  // } else {
  //   return service.post('biz/car/add', dataForm)
  // }
}


export const useCarSubmitApi = (dataForm: any) => {
  if (dataForm.id) {
    return service.put('/biz/car', dataForm)
  } else {
    return service.post('/biz/car', dataForm)
  }
}

export const useCarListApi = (data: undefined | any = undefined) => {
  return service.get('/biz/car/list', {
    params: data
  })
}
export const useCarAllListApi = (data: undefined | any = undefined) => {
  return service.get('/biz/car/listAll', {
    params: data
  })
}
export const useImeiListApi = () => {
  return service.get('gps/device/list')
}
export const transferApi = (data) => {
  return service.get('/biz/car/page', {
    params: data
  })
}

export const transmitChangesApi = (data) => {
  return service.post('biz/car/transfer', data)
}

export const getTheDetailsApi = (imei) => {
  return service.get('biz/car/infoByImei/'+imei)
}
